{
	name:"MirrorLine",
	onInit(){
		this.ctrlIndex = -1
		this.mirror = true
	},
	onClick(pos,e,meta){
		let line = this.queryLines(pos)
		let step = this.step
		if(step.isEmpty()){
			this.step.push({line,pos})
			this.hl(line,pos)
			this.toast("请选择中心线")
			return
		}

		if(line){
			this.onCommit(line,pos)
		}else{
			this.toast("请选择中心线")
		}
	},
	onCommit(line,pos){
		let sp0 = this.step[0]
		let tline = sp0.line
		let tpos = sp0.pos
		let step=[]
		let cmeta = this.getLM(line,pos)
		let tmeta = this.getLM(tline,tpos)
		let sp = tmeta.sp
		let mpos = Math.mirrorPoint({
			x:tmeta.x,
			y:tmeta.y,
			a:cmeta.a+Math.PI/2
		},cmeta)
		mpos.merge({
			a:cmeta.a*2-tmeta.a,
			text:tmeta.text
		})
		step.push(mpos)
		if(sp){
			let smpos = Math.mirrorPoint({
				x:sp.x,
				y:sp.y,
				a:cmeta.a+Math.PI/2
			},cmeta)
			smpos.text=sp.text
			step.push(smpos)
		}
		let action = this.getLineType(tline.action)
		this.step = step
		this.commit(action,this.name)
	}
}